home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / RCS / ulog.h,v < prev    next >
Encoding:
Text File  |  1989-07-14  |  4.3 KB  |  204 lines

  1. head     1.6;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.6
  10. date     89.07.14.09.10.11;  author rab;  state Exp;
  11. branches ;
  12. next     1.5;
  13.  
  14. 1.5
  15. date     88.11.23.14.04.53;  author douglis;  state Exp;
  16. branches ;
  17. next     1.4;
  18.  
  19. 1.4
  20. date     88.09.23.09.11.46;  author douglis;  state Exp;
  21. branches ;
  22. next     1.3;
  23.  
  24. 1.3
  25. date     88.09.13.17.21.18;  author douglis;  state Exp;
  26. branches ;
  27. next     1.2;
  28.  
  29. 1.2
  30. date     88.09.13.16.51.52;  author douglis;  state Exp;
  31. branches ;
  32. next     1.1;
  33.  
  34. 1.1
  35. date     88.08.14.14.48.24;  author douglis;  state Exp;
  36. branches ;
  37. next     ;
  38.  
  39.  
  40. desc
  41. @declarations for the user log (utmp equivalent).
  42. @
  43.  
  44.  
  45. 1.6
  46. log
  47. @*** empty log message ***
  48. @
  49. text
  50. @/*
  51.  * ulog.h --
  52.  *
  53.  *    Declarations of structures, constants, and procedures to manage
  54.  *    the global database of user login/logouts.
  55.  *
  56.  * Copyright 1987, 1988 Regents of the University of California
  57.  * Permission to use, copy, modify, and distribute this
  58.  * software and its documentation for any purpose and without
  59.  * fee is hereby granted, provided that the above copyright
  60.  * notice appear in all copies.  The University of California
  61.  * makes no representations about the suitability of this
  62.  * software for any purpose.  It is provided "as is" without
  63.  * express or implied warranty.
  64.  *
  65.  * $Header: /sprite/src/lib/include/RCS/ulog.h,v 1.5 88/11/23 14:04:53 douglis Exp Locker: rab $ SPRITE (Berkeley)
  66.  */
  67.  
  68. #ifndef _ULOG
  69. #define _ULOG
  70.  
  71. /*
  72.  * It's not clear how to handle ports.  We could use a shared file with indexes
  73.  * corresponding to "ttys", but there are other issues (like the fact that
  74.  * the kernel only maintains idle time measurements for the console, not
  75.  * for rlogins).  Therefore, define ULOG_LOC_CONSOLE as a single index
  76.  * that distinguishes local logins from remote, and use the rloginN numbers
  77.  * as non-zero indexes for the remote logins.
  78.  */
  79.  
  80. #define ULOG_LOC_CONSOLE 0
  81.  
  82.  
  83. /*
  84.  * Since each host has a region in the userLog file allocated to it,
  85.  * the number of entries for each host is (unfortunately) fixed.  This is
  86.  * done for simplicity.  The routines may later be changed to lock the
  87.  * file and find a free entry at any location rather than basing the location
  88.  * on hostID and portID.
  89.  */
  90.  
  91. #define ULOG_MAX_PORTS 10
  92.  
  93. /*
  94.  * Define the maximum length of a location entry.
  95.  */
  96. #define ULOG_LOC_LENGTH 33
  97.  
  98. /*
  99.  * Define the database files used for storing the per-user and per-host/port
  100.  * logs.
  101.  */
  102.  
  103. #define LASTLOG_FILE_NAME "/sprite/admin/lastLog"
  104. #define ULOG_FILE_NAME "/sprite/admin/userLog"
  105.  
  106. /*
  107.  * Define the structure used internally by user programs.
  108.  */
  109. typedef struct {
  110.     int    uid;        /* user identifier */
  111.     int hostID;        /* host for which data is valid */
  112.     int portID;        /* port within host */
  113.     int updated;    /* time updated (in seconds since 1/1/70); 0 if
  114.                invalid */
  115.     char location[ULOG_LOC_LENGTH];    /* location of user */
  116. } Ulog_Data;
  117.  
  118. extern int        Ulog_RecordLogin();
  119. extern int        Ulog_RecordLogout();
  120. extern Ulog_Data *    Ulog_LastLogin();
  121. extern int        Ulog_ClearLogins();
  122. #endif /* _ULOG */
  123. @
  124.  
  125.  
  126. 1.5
  127. log
  128. @removed "data" from pathnames.
  129. @
  130. text
  131. @d16 1
  132. a16 1
  133.  * $Header: /sprite/src/lib/include/RCS/ulog.h,v 1.4 88/09/23 09:11:46 douglis Exp Locker: douglis $ SPRITE (Berkeley)
  134. d45 1
  135. a45 1
  136.  * Define the maximum length of a location entry.  
  137. d73 1
  138. a73 1
  139. #endif _ULOG
  140. @
  141.  
  142.  
  143. 1.4
  144. log
  145. @changed back to data from data.new.  changed return value of
  146. Ulog_LastLogin and added a new routine.
  147. @
  148. text
  149. @d16 1
  150. a16 1
  151.  * $Header: ulog.h,v 1.3 88/09/13 17:21:18 douglis Exp $ SPRITE (Berkeley)
  152. d54 2
  153. a55 2
  154. #define LASTLOG_FILE_NAME "/sprite/admin/data/lastLog"
  155. #define ULOG_FILE_NAME "/sprite/admin/data/userLog"
  156. @
  157.  
  158.  
  159. 1.3
  160. log
  161. @moved *_FILE_NAME declarations into this so user programs
  162. could get at them if needed.
  163. @
  164. text
  165. @d16 1
  166. a16 1
  167.  * $Header: ulog.h,v 1.2 88/09/13 16:51:52 douglis Exp $ SPRITE (Berkeley)
  168. d54 2
  169. a55 2
  170. #define LASTLOG_FILE_NAME "/sprite/admin/data.new/lastLog"
  171. #define ULOG_FILE_NAME "/sprite/admin/data.new/userLog"
  172. d69 4
  173. a72 3
  174. extern int    Ulog_RecordLogin();
  175. extern int    Ulog_RecordLogout();
  176. extern int    Ulog_LastLogin();
  177. @
  178.  
  179.  
  180. 1.2
  181. log
  182. @just changed a comment
  183. @
  184. text
  185. @d16 1
  186. a16 1
  187.  * $Header: ulog.h,v 1.1 88/08/14 14:48:24 douglis Exp $ SPRITE (Berkeley)
  188. d49 11
  189. @
  190.  
  191.  
  192. 1.1
  193. log
  194. @Initial revision
  195. @
  196. text
  197. @d16 1
  198. a16 1
  199.  * $Header: ulog.h,v 1.1 88/07/14 17:23:53 ouster Exp $ SPRITE (Berkeley)
  200. d50 1
  201. a50 1
  202.     int    uid;        /* unique identifier */
  203. @
  204.